package com.test1230pm;

public class Test02 {
    public static void main(String[] args) {
        // (2)设计一个圆形类
        // 属性：半径、PI
        // 功能：周长、面积
        // 要求：分别创建3个对象、求周长、求面积
        Round r = new Round(5);
        r.mianJ();
        r.zhouC();
        Round r1 = new Round(4);
        r1.mianJ();
        r1.zhouC();
        Round r2 = new Round(6);
        r2.mianJ();
        r2.zhouC();

    }
}
class Round{
    private int r;
    private static final double PI=3.14;

    public Round() {
    }

    public Round(int r) {
        this.r = r;
    }
    public void zhouC(){
        System.out.println("周长为"+2*PI*r);
    }
    public void mianJ(){
        System.out.println("面积为"+PI*r*r);
    }
}